<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>math取整</title>
</head>
<body>
    <script>
        var x=Number(prompt('请输入本次运动时间'));
        if(x>20){
            console.log(Math.ceil(x));
        }
        else{
            console.log(Math.floor(x));
        }
    </script>
</body>
</html>